import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.14

Item {
    id:root
    property string itemText: ''
    property bool isjoinGroup: false
    property int currentInx: 0
    property bool checked : false

    signal clicked1(int index);

    function reClicked(){
        realcheckbox.checked = true;
    }

    onCheckedChanged: {
        realcheckbox.checked = root.checked
    }

    Rectangle{
        anchors.fill: parent
        border.color: "#C6C6C6"
        border.width: 1

        RowLayout{
            anchors.fill: parent

            CheckBox{
                id:realcheckbox
                Layout.alignment:Qt.AlignHCenter | Qt.AlignCenter
                Layout.leftMargin: 20
                onClicked: {
                    root.clicked1(currentInx);
                }
            }

            Text {
                text: root.itemText
                font.pixelSize: 20
                color: '#000'
                font.bold: true
                Layout.alignment:Qt.AlignHCenter | Qt.AlignCenter
                Layout.rightMargin: 20
            }
        }
    }
}

